package openmarket.dao.impl;

import java.sql.SQLException;

import openmarket.dao.SqlMapConf;
import openmarket.dao.UserDAO;
import openmarket.dao.dataobject.UserDO;

public class UserDAOImpl implements UserDAO {

	public void addUser(UserDO userDO) throws SQLException {
		SqlMapConf.getInstance().insert("addUser", userDO);
	}

	public void deleteUserByName(String name) throws SQLException {
		SqlMapConf.getInstance().delete("deleteUserByName", name);

	}

	public UserDO getUserByName(String name) throws SQLException {
		return (UserDO) SqlMapConf.getInstance().queryForObject(
				"getUserByName", name);
	}

	public void updateUserByName(UserDO userDO) throws SQLException {
		SqlMapConf.getInstance().update("updateUserByName", userDO);

	}

}
